package com.ejlchina.cashier;

import java.util.HashMap;
import java.util.Map;

/**
 * 代付结果
 * 
 * @author Troy.Zhou
 *
 */
public class PayRes {

	/**
	 * 代付状态：代付中
	 */
	public static int STATUS_PAYING = 1;
	
	/**
	 * 代付状态：代付成功
	 */
	public static int STATUS_SUCCESS = 2;
	
	/**
	 * 代付状态：代付失败
	 */
	public static int STATUS_FAILED = 3;
	
	/**
	 * 代付状态
	 */
	private int status;
	
	/**
	 * 结果描述信息
	 */
	private String message;

	/**
	 * 附加信息
	 */
	private Map<String, Object> extInfo = new HashMap<>();

	
	public boolean isPaying() {
		return status == STATUS_PAYING;
	}
	
	public boolean isSuccess() {
		return status == STATUS_SUCCESS;
	}
	
	public boolean isFailed() {
		return status == STATUS_FAILED;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
	public void putExtInfo(String key, Object value) {
		extInfo.put(key, value);
	}
	
	public Object getExtInfo(String key) {
		return extInfo.get(key);
	}
	
}
